package com.wanmait.movie.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

/**
 * Created by Mybatis Generator 2023/11/30
 */
@Data
@TableName(value = "movie")
@Accessors(chain = true)
@Document(indexName = "movie")
@Setting(shards = 5 , replicas = 1)
public class Movie implements Serializable {
    /**
     * 电影id
     */
    @Id
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 电影名
     */
    @Field(name = "movie_name",type = FieldType.Text,analyzer = "ik_max_word")
    @TableField(value = "movie_name")
    private String movieName;

    /**
     * 电影简介
     */
    @Field(type = FieldType.Text)
    @TableField(value = "introduction")
    private String introduction;

    /**
     * 语言
     */
    @Field(type = FieldType.Keyword)
    @TableField(value = "language")
    private String language;

    /**
     * 时长
     */
    @Field(type = FieldType.Integer)
    @TableField(value = "time")
    private Integer time;

    /**
     * 上映时间
     */
    @Field(name = "release_time" , type = FieldType.Date,format = {} , pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @TableField(value = "release_time")
    private Date releaseTime;

    /**
     * 下映时间
     */
    @Field(name = "end_time" , type = FieldType.Date,format = {} , pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @TableField(value = "end_time")
    private Date endTime;

    /**
     * 电影图片
     */
    @Field(name = "movie_pic" , type = FieldType.Keyword)
    @TableField(value = "movie_pic")
    private String moviePic;

    /**
     * 片源地
     */
    @Field(type = FieldType.Keyword)
    @TableField(value = "source")
    private String source;

    /**
     * 导演
     */
    @Field(name = "actor_director" , type = FieldType.Integer)
    @TableField(value = "actor_director")
    private Integer actorDirector;

    @TableField(exist = false)
    private Actor actor;

    /**
     * 总分
     */
    @Field(type = FieldType.Integer)
    @TableField(value = "score")
    private Double score;

    /**
     * 评分人数
     */
    @Field(type = FieldType.Integer)
    @TableField(value = "peoples")
    private Integer peoples;

    /**
     * 票房
     */
    @Field(name = "box_office" , type = FieldType.Double)
    @TableField(value = "box_office")
    private Double boxOffice;

    /**
     * 想看
     */
    @Field(type = FieldType.Integer)
    @TableField(value = "want")
    private Integer want;

    /**
     * 添加时间
     */
    @Field(name = "insert_time" , type = FieldType.Date,format = {} , pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @TableField(value = "insert_time")
    private Date insertTime;

    /**
     * 修改时间
     */
    @Field(name = "update_time" , type = FieldType.Date,format = {} , pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 添加人
     */
    @Field(name = "insert_admin_id",type = FieldType.Integer)
    @TableField(value = "insert_admin_id")
    private Integer insertAdminId;

    /**
     * 修改人
     */
    @Field(name = "update_admin_id",type = FieldType.Integer)
    @TableField(value = "update_admin_id")
    private Integer updateAdminId;

    /**
     * enable
     */
    @Field(type = FieldType.Boolean)
    @TableField(value = "enable")
    private Boolean enable;

    private static final long serialVersionUID = 1L;

    public static final String COL_MOVIE_NAME = "movie_name";

    public static final String COL_INTRODUCTION = "introduction";

    public static final String COL_LANGUAGE = "language";

    public static final String COL_TIME = "time";

    public static final String COL_RELEASE_TIME = "release_time";

    public static final String COL_END_TIME = "end_time";

    public static final String COL_MOVIE_PIC = "movie_pic";

    public static final String COL_SOURCE = "source";

    public static final String COL_ACTOR_DIRECTOR = "actor_director";

    public static final String COL_SCORE = "score";

    public static final String COL_PEOPLES = "peoples";

    public static final String COL_BOX_OFFICE = "box_office";

    public static final String COL_WANT = "want";

    public static final String COL_INSERT_TIME = "insert_time";

    public static final String COL_UPDATE_TIME = "update_time";

    public static final String COL_INSERT_ADMIN_ID = "insert_admin_id";

    public static final String COL_UPDATE_ADMIN_ID = "update_admin_id";

    public static final String COL_ENABLE = "enable";
}